<#include '/admin/header.html' >


<script src="${ctx}/shop/admin/statistics/member/js/buy_analysis.js" type="text/javascript" ></script>
<div class="main">
	<!-- 搜索框 -->
	<div style="display: block;" class="searchAdvanced">
		<table width="98%" border="0" cellspacing="0" cellpadding="8">
			<tr>
				<td width="80">
					按订单周期：
				</td>
				<td width="70" >
					<select id="cycle_type">
						<!-- <option value="0">--请选择--</option> -->
						<option value="1">按照月统计</option>
						<option value="2">按照年统计</option>
					</select>
				</td>
				<td width="70" >
					<select id="year">
						<option value="0">--全年--</option>
					</select>
				</td>
				<td width="70" >
					<select id="month">
						<!-- <option value="0">--请选择--</option> -->
					</select>
				</td>
				
				<td width="200" style="text-align: center;float: right">
					<a id="search_statis" class="button blueButton"  href="javascript:void(0);">开始搜索</a>
				</td>
				<td></td>
		</table>
	</div>
	<div class="clear height10"></div>
	
	<!-- 主体 -->
	<div class="input">
		<div style="display: block;" class="goods_input">
			
			<h2>客单价分布图    <input type="button" id="set_sections_btn" class="button" value="设置价格区间" </h2> 
			<hr color="#ccc" />
			<div id="order_price_dis"></div>
			
		</div>
		<!-- 购买频次统计图 -->
		<div class="buy_fre">
			<br />
			<h2>购买频次分析表</h2>
			<hr color="#ccc" />
			<table id="buy_fre_dg" class="easyui-datagrid"
				data-options="pagination:false,rownumbers:true, fitColumns:'true'" >
				<thead>
					<tr>
						<th data-options="checkbox:true,width:100"></th>
						<th data-options="field:'buy_num',width:150,sortable:'true'" >购买频次</th>
						<th data-options="field:'member_num',width:100,sortable:'true'" >下单会员数量</th>
						<th data-options="field:'total_num',width:100,formatter:function(value,rowData,rowIndex){
							
							if (parseInt(rowData.member_num) == 0) {
								return '0.00%';
							}
							
							var val = parseInt(rowData.member_num)/parseInt(value);
							
							//先转换成4位小数
							val = val.toFixed(4);
 							val = val.slice(2,4)+'.'+val.slice(4,6)+'%';
							return val;
						}" >人数占比</th>
					</tr>
				</thead>
			</table>
		</div>
		<br />
		<h2>购买时段分布图 </h2> 
		<hr color="#ccc" />
		<div id="buy_time_dis"></div>
	</div>	
	<div class="clear height10"></div>
	
	<!-- 隐藏dialog -->
	<div style="display:none;">
		<div id="dialog_div" style="padding:20px;">
			<!-- 区间数据是否有并且正确 -->
			<input type="hidden" id="sections_is_true" value="0" />
			<!-- 保存区间表单序列化后的值，防止搜索时使用了错误数据 -->
			<input type="hidden" id="sections_serialize" value="" />
			<form id="section_form">
					 <input type="hidden" name="sections" value="0" />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				价格：<input type="text" class="input_text" name="sections" value="" /> <br />
				
			</form>
		</div>
	</div>
</div>


<#include '/admin/footer.html' >